{#

 This file is part of the FOSCommentBundle package.

 (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>

 This source file is subject to the MIT license that is bundled
 with this source code in the file LICENSE.

#}

{% block fos_comment_comment %}
<div id="fos_comment_{{ comment.id }}" class="fos_comment_comment_show fos_comment_comment_depth_{{ depth }} genero-{{ comment.author.sexo }} " {% if parentId is defined %}data-parent="{{ parentId }}"{% endif %}>
    <div class="fos_comment_comment_metas">
        {% block fos_comment_comment_metas %}
            {% block fos_comment_comment_metas_authorline %}
                {% trans from 'FOSCommentBundle' %}fos_comment_comment_show_by{% endtrans %}
                <span class="fos_comment_comment_authorname">
                    {{ comment.authorName }}
                </span> - {{ comment.createdAt|date("d/m/Y H:i") }}
                <a href="javascript:void(0);" onclick="mostrarReportar({{comment.author.id}},2,'{{ comment.id }}')">Reportar</a>
            {% endblock fos_comment_comment_metas_authorline %}
        {% endblock fos_comment_comment_metas %}
    </div>

    <div class="fos_comment_comment_body">
        <div class="image">
            <img src="{{ comment.author.imagenDefault }}"/>
        </div>
        <div class="texto">
            {% block fos_comment_comment_body %}
                {% if comment is fos_comment_deleted %}
                    {% trans from 'FOSCommentBundle' %}fos_comment_comment_deleted{% endtrans %}
                {% else %}
                    {% if comment is fos_comment_raw %}
                        {{ comment.rawBody | raw }}
                    {% else %}
                        {{ comment.body | nl2br }}
                    {% endif %}
                {% endif %}
            {% endblock fos_comment_comment_body %}
        </div>
    </div>

    {% block fos_comment_comment_children %}
        {% if view is not sameas('flat') %}
            <div class="fos_comment_comment_replies">

                {% if fos_comment_can_comment(comment) %}
                    <div class="fos_comment_comment_reply gender-{{ app.user.sexo }}">
                        {% block fos_comment_comment_reply %}
                            <button data-url="{{ url('fos_comment_new_thread_comments', {"id": comment.thread.id}) }}" data-name="{{ comment.authorName }}" data-parent-id="{{ comment.id }}" class="fos_comment_comment_reply_show_form">{% trans from 'FOSCommentBundle' %}fos_comment_comment_show_reply{% endtrans %}</button>
                        {% endblock fos_comment_comment_reply %}
                    </div>
                {% endif %}

                {% if children is defined %}
                    {% include "FOSCommentBundle:Thread:comments.html.twig" with { "comments": children, "depth": depth + 1, "parentId": comment.id, "view": view } %}
                {% endif %}

            </div>
        {% elseif view is sameas('flat') and children is defined %}
            {% include "FOSCommentBundle:Thread:comments.html.twig" with { "comments": children, "depth": depth + 1, "parentId": comment.id, "view": view } %}
        {% endif %}
    {% endblock fos_comment_comment_children %}

</div>
{% endblock fos_comment_comment %}
